
Technical Q&A's
TB 28 - Drag Manager and windowKind 20 (27-November-96)
Q
When I drag from my application into a Finder window, the system
crashes. I noticed Finder uses a windowKind value of 20 for its windows,
and so does my app. When my app avoids windowKind 20, everything's
hunky-dory. What gives?
A
Through the Drag Manager, Finder has gotten access to the windows in
your app's window list (specifically, by using undocumented calls to
obtain the source window of a drag). If your window's windowKind field
is 20, Finder assumes the window is one of its own (as opposed to a
driver window, whose windowKind would be negative, or a dialog window,
whose windowKind would be 2, etc.). Finder grabs the value in the
window's refCon field and type-casts it to a pointer to a C++ object in
Finder's heap. I think you can see where this is going: when Finder
attempts to dereference the pointer, various crashing behaviors result.
The upshot of this Finder bug is that your application should not use
windowKind values of 20.
--Pete Gontier
devsupport@apple.com
Technical Support
Technical Q&As
Previous Question |
Next Question |
Contents
Main |
Top of Section |
What's New |
Apple Computer, Inc. |
Find It |
Feedback |
Help